package com.hx.springboot1.controller;

import com.hx.springboot1.pojo.entity.TabMajor;
import com.hx.springboot1.service.impl.MajorServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Author: hx
 * Date: 2021-05-23 16/15
 * Description: Nothing else
 */
@Controller
public class MajorController {
    @Autowired
    MajorServiceImpl majorService;

    @GetMapping("/selectAllMajor")
    @ResponseBody
    public List<TabMajor> selectAllMajor(){
        return majorService.selectAllMajor();
    }

    @GetMapping("/selectCollegeMajor")
    @ResponseBody
    public List<TabMajor> selectCollegeMajor(Integer collegeId){
        return majorService.selectCollegeMajor(collegeId);
    }
}
